package com.jfreer.springmvc.web.controller;

import com.jfreer.springmvc.service.TestService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created by landy on 2015/4/12.
 */
@Controller
@RequestMapping("/test")
public class TestController {
    @Resource
    private TestService testService;

    @RequestMapping(value = {"", "/", "/index"})
    @ResponseBody
    public Map<String, String> index() {
        return testService.getTestData();
    }

    @RequestMapping("jsp")
    public String jsp() {
        return "test";
    }

    @RequestMapping("admin")
    public String admin() {
        return "admin";
    }
}
